gtkmain: Ensure there is a current event handling crossing events
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 4 May 2017 11:48:27 +0000 (13:48 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 25 May 2017 14:25:59 +0000 (16:25 +0200)
The "current event" will be the real one that is triggering the crossing
notifications, not the synthesized events.

gtk/gtkmain.c

index ca68a45bd8b5b1fdf3a0f71ab3b8cfce1cf29286..910ff0e9fb475a44f7b5ea547c4fe8aef2f25e62 100644 (file)
@@ -1619,17 +1619,17 @@ gtk_main_do_event (GdkEvent *event)
       event_widget = gtk_get_event_widget (event);
     }
 
-  if (is_pointing_event (event))
-    event_widget = handle_pointing_event (event);
-
-  if (!event_widget)
-    return;
-
   /* Push the event onto a stack of current events for
    * gtk_current_event_get().
    */
   current_events = g_list_prepend (current_events, event);
 
+  if (is_pointing_event (event))
+    event_widget = handle_pointing_event (event);
+
+  if (!event_widget)
+    goto cleanup;
+
   window_group = gtk_main_get_window_group (event_widget);
   device = gdk_event_get_device (event);